﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using CreditAgricole.Framework;

namespace CreditAgricole.Application
{
    public static class VOMapperKnowledgeBase
    {
        public static VOKnowledgeBase GetVOBKnowledgeFromListItem(SPListItem item)
        {
            VOKnowledgeBase kbase = new VOKnowledgeBase();
            kbase.Title = MappingTool.CatchNull(item[Constants.TitleField]);
            kbase.Name = MappingTool.CatchNull(item[Constants.NameField]);
            kbase.Created = MappingTool.CatchDateNull(item[Constants.CreatedDateField]);
            kbase.Comment = MappingTool.CatchNull(item[Constants.CommentField]);
            kbase.ValidityDate = MappingTool.CatchDateNull(item[Constants.ValidityDateField]);
            kbase.Product = MappingTool.CatchNull(item[Constants.ProductField]);
            kbase.DocType = MappingTool.CatchNull(item[Constants.DocTypeField]);
            return kbase;
        }
    }
}
